import { getdata } from "../http/management"

export default {
    state: {
        active: false,
        alldata: null,
    },
    effects: {
        //获取用户信息
        *getalluser({ payload }, { call, put }) {
            const res = yield call(getdata, payload)
            if (res.code == 200) {
                yield put({
                    type: 'alluser',
                    payload: res.message
                })
            }

        }
    },
    reducers: {
        //修改状态
        changestatus(state, action) {
            state.active = action.payload
        },
        //获取用户
        alluser(state, action) {
            state.alldata = action.payload
        }
    }
}